package com.zcoj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zcoj.mapper.ImageMapper;
import com.zcoj.pojo.Dto.Image;
import com.zcoj.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author chenbin
 * @version 1.0
 * @description: TODO
 * @date 2023/7/31 23:38
 */
@Service
public class ImageServiceImpl implements ImageService {
	@Autowired
	private ImageMapper imageMapper;

	@Override
	public String getIndexImageBase64() {
		QueryWrapper<Image> queryWrapper=new QueryWrapper<>();
		queryWrapper.eq("id",1);
		Image image = imageMapper.selectOne(queryWrapper);
		return image.getImgbase64();
	}

	@Override
	public Integer modifyImageBase64(String base64) {
		Image image = new Image();
		image.setId(1);
		image.setImgbase64(base64);
		return imageMapper.updateById(image);
	}
}
